/**
 * ?.可选链操作
 */

function main(config) {
  // const dbHost = config && config.db && config.db.host;
  const dbHost = config?.db?.host;
  console.log(dbHost);
}

/* main({
  db: {
    host: "192.168.2.21",
    username: "xxax"
  }
}); */

main();
